Optimal. Leaf size=435 \[ -\frac{\left (\sqrt{-b^2} \left (a^2 b^2 \left (-n^2+6 n+6\right )+3 a^4+b^4 \left (n^2+4 n+3\right )\right )+a b^2 n \left (5 a^2+b^2 (2 n+3)\right )\right ) (a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}\right )}{16 b d (n+1) \left (a^2+b^2\right )^2 \left (a-\sqrt{-b^2}\right )}-\frac{\left (a b^2 n \left (5 a^2+b^2 (2 n+3)\right )-\sqrt{-b^2} \left (a^2 b^2 \left (-n^2+6 n+6\right )+3 a^4+b^4 \left (n^2+4 n+3\right )\right )\right ) (a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right )}{16 b d (n+1) \left (a^2+b^2\right )^2 \left (a+\sqrt{-b^2}\right )}+\frac{\cos ^4(c+d x) (a \tan (c+d x)+b) (a+b \tan (c+d x))^{n+1}}{4 d \left (a^2+b^2\right )}-\frac{\cos ^2(c+d x) \left (a \left (5 a^2+b^2 (2 n+3)\right ) \tan (c+d x)+b \left (a^2 (7-n)+b^2 (n+5)\right )\right ) (a+b \tan (c+d x))^{n+1}}{8 d \left (a^2+b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.803032, antiderivative size = 435, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3516, 1649, 831, 68} \[ -\frac{\left (\sqrt{-b^2} \left (a^2 b^2 \left (-n^2+6 n+6\right )+3 a^4+b^4 \left (n^2+4 n+3\right )\right )+a b^2 n \left (5 a^2+b^2 (2 n+3)\right )\right ) (a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}\right )}{16 b d (n+1) \left (a^2+b^2\right )^2 \left (a-\sqrt{-b^2}\right )}-\frac{\left (a b^2 n \left (5 a^2+b^2 (2 n+3)\right )-\sqrt{-b^2} \left (a^2 b^2 \left (-n^2+6 n+6\right )+3 a^4+b^4 \left (n^2+4 n+3\right )\right )\right ) (a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right )}{16 b d (n+1) \left (a^2+b^2\right )^2 \left (a+\sqrt{-b^2}\right )}+\frac{\cos ^4(c+d x) (a \tan (c+d x)+b) (a+b \tan (c+d x))^{n+1}}{4 d \left (a^2+b^2\right )}-\frac{\cos ^2(c+d x) \left (a \left (5 a^2+b^2 (2 n+3)\right ) \tan (c+d x)+b \left (a^2 (7-n)+b^2 (n+5)\right )\right ) (a+b \tan (c+d x))^{n+1}}{8 d \left (a^2+b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3516
Rule 1649
Rule 831
Rule 68
Rubi steps
\begin{align*} \int \sin ^4(c+d x) (a+b \tan (c+d x))^n \, dx &=\frac{b \operatorname{Subst}\left (\int \frac{x^4 (a+x)^n}{\left (b^2+x^2\right )^3} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}-\frac{\operatorname{Subst}\left (\int \frac{(a+x)^n \left (b^4 \left (a^2+b^2 (1+n)\right )-a b^4 (2-n) x-4 b^2 \left (a^2+b^2\right ) x^2\right )}{\left (b^2+x^2\right )^2} \, dx,x,b \tan (c+d x)\right )}{4 b \left (a^2+b^2\right ) d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b \left (a^2 (7-n)+b^2 (5+n)\right )+a \left (5 a^2+b^2 (3+2 n)\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{\operatorname{Subst}\left (\int \frac{(a+x)^n \left (b^4 \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )+a b^4 n \left (5 a^2+b^2 (3+2 n)\right ) x\right )}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{8 b^3 \left (a^2+b^2\right )^2 d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b \left (a^2 (7-n)+b^2 (5+n)\right )+a \left (5 a^2+b^2 (3+2 n)\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{\operatorname{Subst}\left (\int \left (\frac{\left (-a b^6 n \left (5 a^2+b^2 (3+2 n)\right )+b^4 \sqrt{-b^2} \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )\right ) (a+x)^n}{2 b^2 \left (\sqrt{-b^2}-x\right )}+\frac{\left (a b^6 n \left (5 a^2+b^2 (3+2 n)\right )+b^4 \sqrt{-b^2} \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )\right ) (a+x)^n}{2 b^2 \left (\sqrt{-b^2}+x\right )}\right ) \, dx,x,b \tan (c+d x)\right )}{8 b^3 \left (a^2+b^2\right )^2 d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b \left (a^2 (7-n)+b^2 (5+n)\right )+a \left (5 a^2+b^2 (3+2 n)\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}-\frac{\left (a b^2 n \left (5 a^2+b^2 (3+2 n)\right )-\sqrt{-b^2} \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )\right ) \operatorname{Subst}\left (\int \frac{(a+x)^n}{\sqrt{-b^2}-x} \, dx,x,b \tan (c+d x)\right )}{16 b \left (a^2+b^2\right )^2 d}+\frac{\left (a b^2 n \left (5 a^2+b^2 (3+2 n)\right )+\sqrt{-b^2} \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )\right ) \operatorname{Subst}\left (\int \frac{(a+x)^n}{\sqrt{-b^2}+x} \, dx,x,b \tan (c+d x)\right )}{16 b \left (a^2+b^2\right )^2 d}\\ &=-\frac{\left (a b^2 n \left (5 a^2+b^2 (3+2 n)\right )+\sqrt{-b^2} \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )\right ) \, _2F_1\left (1,1+n;2+n;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{16 b \left (a^2+b^2\right )^2 \left (a-\sqrt{-b^2}\right ) d (1+n)}-\frac{\left (a b^2 n \left (5 a^2+b^2 (3+2 n)\right )-\sqrt{-b^2} \left (3 a^4+a^2 b^2 \left (6+6 n-n^2\right )+b^4 \left (3+4 n+n^2\right )\right )\right ) \, _2F_1\left (1,1+n;2+n;\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{16 b \left (a^2+b^2\right )^2 \left (a+\sqrt{-b^2}\right ) d (1+n)}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b \left (a^2 (7-n)+b^2 (5+n)\right )+a \left (5 a^2+b^2 (3+2 n)\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}\\ \end{align*}
Mathematica [B] time = 6.5794, size = 910, normalized size = 2.09 \[ \frac{b \left (\frac{\, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{n+1}}{2 \sqrt{-b^2} \left (a-\sqrt{-b^2}\right ) (n+1)}-\frac{\, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{n+1}}{2 \sqrt{-b^2} \left (a+\sqrt{-b^2}\right ) (n+1)}+\frac{\cos ^4(c+d x) \left (b^2+a \tan (c+d x) b\right ) (a+b \tan (c+d x))^{n+1}}{4 b^2 \left (a^2+b^2\right )}-\frac{\cos ^2(c+d x) \left (b^2+a \tan (c+d x) b\right ) (a+b \tan (c+d x))^{n+1}}{b^2 \left (a^2+b^2\right )}+\frac{\frac{\left (\sqrt{-b^2} \left (a^2+b^2 (1-n)\right )-a b^2 n\right ) \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{n+1}}{b^2 \left (a-\sqrt{-b^2}\right ) (n+1)}-\frac{\left (\sqrt{-b^2} a^2+b^2 n a-\left (-b^2\right )^{3/2} (1-n)\right ) \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{n+1}}{b^2 \left (a+\sqrt{-b^2}\right ) (n+1)}}{2 \left (a^2+b^2\right )}-\frac{b^2 \left (\frac{\cos ^2(c+d x) (a+b \tan (c+d x))^{n+1} \left (\left (-3 a^2-b^2 (3-n)\right ) b^2+a^2 (2-n) b^2+\left (a \left (-3 a^2-b^2 (3-n)\right )-a b^2 (2-n)\right ) \tan (c+d x) b\right )}{2 b^4 \left (a^2+b^2\right )}-\frac{\frac{\left (a b^2 \left (3 a^2+b^2 (5-2 n)\right ) n-\sqrt{-b^2} \left (3 a^4+b^2 \left (-n^2-2 n+6\right ) a^2+b^4 \left (n^2-4 n+3\right )\right )\right ) \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{n+1}}{2 b^2 \left (a-\sqrt{-b^2}\right ) (n+1)}+\frac{\left (a \left (3 a^2+b^2 (5-2 n)\right ) n b^2+\sqrt{-b^2} \left (3 a^4+b^2 \left (-n^2-2 n+6\right ) a^2+b^4 \left (n^2-4 n+3\right )\right )\right ) \, _2F_1\left (1,n+1;n+2;\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right ) (a+b \tan (c+d x))^{n+1}}{2 b^2 \left (a+\sqrt{-b^2}\right ) (n+1)}}{2 b^2 \left (a^2+b^2\right )}\right )}{4 \left (a^2+b^2\right )}\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.556, size = 0, normalized size = 0. \begin{align*} \int \left ( \sin \left ( dx+c \right ) \right ) ^{4} \left ( a+b\tan \left ( dx+c \right ) \right ) ^{n}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{4}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1\right )}{\left (b \tan \left (d x + c\right ) + a\right )}^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{4}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]